package com.bdqn.hospital.mapper;

import com.bdqn.hospital.pojo.MedicalAdvice;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @version : 1.0
 * @Author :guogd
 * @createTime: 2023/03/01 14:30
 * @Description: com.bdqn.hospital.mapper
 */
@Mapper
public interface MedicalAdviceMapper {

    /**
     * 添加医嘱表
     * @param medicalAdvice
     * @return
     */
    @Insert("insert into medical_advice values(null,#{registryId},#{userId},#{chiefComplaint},#{diagnosis},now(),null)")
    Integer insert(MedicalAdvice medicalAdvice);

    /**
     * 根据挂号单id获取遗嘱信息
     * @param registryId
     * @return
     */
    @Select("select * from medical_advice where registry_id=#{registryId}")
    MedicalAdvice getByRegistryId(Integer registryId);
}
